// import { Switch } from 'antd-mobile';
import React from 'react';
import { HashRouter as Router, Route, NavLink, Switch, Redirect } from 'react-router-dom';
import Hot from './Hot';
import Recent from './Recent';

const List = () => {
    return <div style={{ marginTop: '5px' }}>
        <Router>
            <nav style={{ marginBottom: '13px' }}>
                <NavLink activeClassName="active" activeStyle={{ fontSize: "1.5em", fontWeight: 'bold' }} to='/home/hot'><span>热门</span></NavLink>
                <span style={{ marginLeft: '10px' }}></span>
                <NavLink activeClassName="active" activeStyle={{ fontSize: "1.5em", fontWeight: 'bold' }} to='/home/recent'><span>近期</span></NavLink>
            </nav>
            <Switch>

                <Route path='/home/hot' component={Hot}></Route>
                <Route path='/home/recent' component={Recent}></Route>
                <Redirect from='/home' to='/home/hot' />
                {/* <Route render={() => <Redirect to='/home/hot' />} /> */}
            </Switch>
            <div style={{ height: '45px' }}></div>
        </Router>
    </div>

}
export default List;
